﻿#include "CmdSaveActiveClipperSettingData.h"
#include <QFile>
#include <QDebug>
#include "BaseModule/IBaseSignal.h"
#include "PostCommandPy.h"

namespace PostCommand
{
    CmdSaveActiveClipperSettingData::CmdSaveActiveClipperSettingData()
        : CommandBase()
    {
        this->initCmdName();
    }
    CmdSaveActiveClipperSettingData::~CmdSaveActiveClipperSettingData()
    {
    }

    bool CmdSaveActiveClipperSettingData::execute()
    {
        emit IBaseSignalInstance->signal_saveActiveClipperSettingData(m_windowUniversalID, m_toolButtonActiveClipperIsChecked,
                                                                      m_toolButtonModelDisplayIsChecked, m_hasAnyGeometrySuccess, m_direction, m_clipperValue);
        return true;
    }

    void CmdSaveActiveClipperSettingData::undo()
    {
    }

    void CmdSaveActiveClipperSettingData::redo()
    {
        // execute();
    }

    void CmdSaveActiveClipperSettingData::saveActiveClipperSettingData(int windowUniversalID, bool toolButtonActiveClipperIsChecked, bool toolButtonModelDisplayIsChecked, bool hasAnyGeometrySuccess, QString direction, double clipperValue)
    {
        m_windowUniversalID = windowUniversalID;
        m_toolButtonActiveClipperIsChecked = toolButtonActiveClipperIsChecked;
        m_toolButtonModelDisplayIsChecked = toolButtonModelDisplayIsChecked;
        m_hasAnyGeometrySuccess = hasAnyGeometrySuccess;
        m_direction = direction;
        m_clipperValue = clipperValue;     
    }

} // namespace PostCommand
